const app = getApp();
// const common = require('./commonUtils.js');
export function wxLogin(params) {
  return new Promise((resolve, reject) => {
    let data = {};
    wx.login({
      success(res) {
        console.log(res);
        data.code = res.code;
        data.wxAppId = 'wx7d2cc9328915f8fb';
        wx.request({
          url: 'https://m.feawin.com/vote/auth',
          method: 'POST',
          data: data,
          header: {
            'content-type': 'application/x-www-form-urlencoded',
            // 'custom': JSON.stringify(common.getHeader())
          },
          success(res) {
            resolve(res.data);
          }
        })
      }
    })
  })
}